An Analysis of the Current Program Slicing and Algorithmic Debugging Based Techniques

نویسندگان

  • JOSEP SILVA
  • Germán Vidal
چکیده

slice provides additional information: it says for each statement in the slice if the condition c =‘\n’ will be satisfied or not. (1) read(text); [false] (2) read(n); [false] (3) lines = 1; [c!=‘\n’] (4) chars = 1; [false] (5) subtext = ""; [false] (6) c = getChar(text); [false] (7) while (c != ‘\eof’) [false] (8) if (c == ‘\n’) [false] (9) then lines = lines + 1; [false] (10) chars = chars + 1; [false] (11) else chars = chars + 1; [false] (12) if (n != 0) [false] (13) then subtext = subtext ++ c; [false] (14) n = n 1; [false] (15) c = getChar(text); [false] (16) write(lines); [c!=‘\n’] (17) write(chars); [false] (18) write(subtext); [false] Fig. 23. Abstract slice of Figure 1 (a) with respect to 〈16, c =‘\n’, [(1), text = “hello world!\eof”]〉 Question answered: Under which variable values do the program’s statements affect or are affected by the slicing criterion? Main applications: Program comprehension. 2.24 Amorphous Slicing (Harman and Danicic, 1997) All approaches to slicing discussed so far have been based on two assumptions: the slice preserves (part of) the semantics of the program, and it is “syntax preserving”, i.e., the slice is a subset of the original program statements. In contrast, amorphous slices [Harman and Danicic 1997] preserve the semantics restriction but they drop the syntactic restriction: amorphous slices are constructed using some program transformation which simplifies the program and which preserves the semantics of the program with respect to the slicing criterion. In the literature (see, e.g. [Ward 2002; 2003; Ward and Zedan 2007], when a slicing technique is restricted to statement deletion it is also referred to as syntactic slicing, as opposed to semantic slicing where only the semantic restriction must be preserved. The syntactic freedom allows amorphous slicing to perform greater simplifications, thus often being considerably smaller than conventional program slicing. These simplifications are very convenient in the context of program comprehension where the user needs to simplify the program as much as possible in order to understand a part of the semantics of the program having the syntax less importance. For instance, consider Program 1 in Figure 24 together with the slicing criterion 〈3, {chars}〉. An intraprocedural static slice of this program would contain the whole program (Program 1). In contrast, an interprocedural static slice would remove statements 4, 5 and 6 (Program 2). Finally, its amorphous slice would be

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Debugging techniques for declarative languages: Profiling, program slicing and algorithmic debugging

The task of debugging can be arduous. A bug can be evident with a single glance, or it can be hidden in the deepest lurking place of our program. Nevertheless, surprisingly, debugging is one of the software processes that has been mostly abandoned by the scientific community, and the same debugging techniques used twenty years ago are still being used today. The situation is not different regar...

متن کامل

Comparison of Backward Slicing Techniques for Java

Program slicing is an important approach for debugging, program comprehension, impact analysis, etc. There are various program slicing techniques ranging from the lightweight to the more accurate but heavyweight. Comparative analyses are important for selecting the most appropriate technique. This paper presents a comparative study of four backward program slicing techniques for Java. The resul...

متن کامل

Logic Programming Environments: Dynamic Program Analysis and Debugging

D Programming environments are essential for the acceptance of programming languages. This survey emphasizes that program analysis, both static and dynamic, is the central issue of programming environments. Because their clean semantics makes powerful analysis possible, logic programming languages have an indisputable asset in the long term. This survey is focused on logic program analysis and ...

متن کامل

Incremental Slicing Based on Data-Dependences Types

Program slicing is useful for assisting with software-maintenance tasks, such as program understanding, debugging, impact analysis, and regression testing. The presence and frequent usage of pointers, in languages such as C, causes complex data dependences. To function effectively on such programs, slicing techniques must account for pointerinduced data dependences. Although many existing slici...

متن کامل

Slicing of Constraint Logic Programs

Abstract. Slicing is a program analysis technique originally developed for imperative languages. It facilitates understanding of data flow and debugging. This paper discusses slicing of Constraint Logic Programs. Constraint Logic Programming (CLP) is an emerging software technology with a growing number of applications. Data flow in constraint programs is not explicit, and for this reason the c...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2008